#pragma once

#include "Affix.h"

class Effect {
	friend class Affix;
public:
	Effect(unsigned long mgef, const Effect* neg = NULL);

	unsigned long getMGEF() const;
	bool setMGEF(unsigned long newVal);
	const Effect* getNegative() const;
	bool setNegative(const Effect* newVal);

	bool hasAffix(const Soulgem& soulLevel) const;
	string getAffix(const Soulgem& soulLevel) const;
	bool setAffix(const Soulgem& soulLevel, const string name);
	bool clrAffix(const Soulgem& soulLevel);

	const Affix& operator[](const Soulgem& soulLevel) const;
	Affix& operator[](const Soulgem& soulLevel);

	bool hasAffixes(const unsigned int bitmap) const;

	bool getOnSelf() const;
	bool setOnSelf(const bool newVal);

	bool getNoVars() const;
	bool setNoVars(const bool newVal);

	unsigned int getMinUses() const;
	bool setMinUses(const unsigned int newVal);

	unsigned int getMaxUses() const;
	bool setMaxUses(const unsigned int newVal);

	float getNoDurChance() const;
	bool setNoDurChance(const float newVal);

	float getMinMagPct() const;
	bool setMinMagPct(const float newVal);

	float getMinDurPct() const;
	bool setMinDurPct(const float newVal);

	float getRank() const;
	bool setRank(const float newVal);

	float getFreq() const;
	bool setFreq(const float newVal);
private:
	unsigned long code;

	Affix sub;
	Affix lea;
	Affix les;
	Affix com;
	Affix grt;
	Affix grn;
	Affix ult;
	unsigned long souls;

	const Effect* negative;

	bool onSelf;

	bool noVars;

	unsigned int minUses;
	unsigned int maxUses;
	float noDurChance;
	float minMagPct;
	float minDurPct;

	float rank;
	float freq;
};
